﻿
// DcmFileEditorDlg.h: 头文件
//

#pragma once
#include "DcmParser.h"
#include "EditListCtrl.h"

struct TAGInfo
{
	CString tagDesc;
	CString tagId;
	CString tagVr;
};


// CDcmFileEditorDlg 对话框
class CDcmFileEditorDlg : public CDialogEx
{
// 构造
public:
	CDcmFileEditorDlg(CWnd* pParent = nullptr);	// 标准构造函数

// 对话框数据
#ifdef AFX_DESIGN_TIME
	enum { IDD = IDD_DCMFILEEDITOR_DIALOG };
#endif

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV 支持


// 实现
protected:
	HICON m_hIcon;

	// 生成的消息映射函数
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnBnClickedButtonOpenfile();
	afx_msg void OnBnClickedButtonOpendir();
	afx_msg void OnBnClickedButtonDelfile();
	afx_msg void OnBnClickedButtonSave();
	afx_msg void OnBnClickedButtonSaveas();
	afx_msg void OnBnClickedButtonAdd();
	afx_msg void OnBnClickedButtonDel();
	afx_msg void OnBnClickedButtonModall();
	afx_msg void OnSelchangeComboTags();
	afx_msg void OnClickListModtag(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnDblclkListFile();
	afx_msg void OnSelchangeComboCompress();
	afx_msg void OnChangeEditSearch();
	DECLARE_MESSAGE_MAP()

private:

	void UpdateWidth(LPCTSTR lpszItem);
	int AddTag(const PrvTag& tag);
	CString GetTagDesc(CString strTag);
	int GetVR(CString vrName);
	void EnumFileInDir(CString dir, std::vector<CString>& vec, LPCTSTR ext = NULL);
	std::vector<DcmTagInfo> filterTags(CString searchText);

	CString m_lastDir;
	std::vector<CString> m_vecDcmFile;
	std::vector<PrvTag> m_overrideTag;
	std::vector<PrvTag> m_dcmTag;
	std::vector<DcmTagInfo>  m_vecCurTags;


	DcmParser m_dcmParser;

	int  m_nListWidth;
	int  m_nDefWidth;

	CListBox m_lstFile;
	CEditListCtrl m_lstTag;
	CListCtrl m_lstModTag;
	CString m_TagId;
	CString m_Val;
	CComboBox m_cmbTAG;
	CComboBox m_cmbVR;
	CString m_TagVr;
	CString m_tagDesc;
	CComboBox m_cmbComp;
	UINT m_quality;
	CString m_search;
	
};
